Skip to main content

What is Git

Git is a distributed version control system (VCS) that helps developers manage and track changes in their codebase over time. It allows multiple people to collaborate on projects efficiently and safely, without fear of overwriting each other's work.

Version Control

Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

Think of it like a "time machine" for your code.

With version control, you can:

  • Revert files back to a previous state

  • Compare changes over time

  • Recover accidentally deleted code

  • Collaborate with others seamlessly

Without version control, working on a team can lead to confusion, lost work, and bugs introduced by conflicting changes.

Centralized vs Distributed Version Control

When talking about version control here are two main types of version control:

Centralized VCS (CVCS)

All changes are stored on a central server. If the server goes down, history may be lost.

Distributed VCS (DVCS)

Every user has a full copy of the repository, including history. Git is a DVCS.

Git's distributed nature makes it faster, safer, and more flexible than older centralized systems.

Why Use Git?

  • Track changes: See what changed, when, and by whom.

  • Backup: Your code and history are saved locally and remotely.

  • Collaboration: Multiple people can work on a project at once.

  • Experimentation: Create branches to try new features without affecting the main project.

  • Performance: Git is fast and optimized for large projects.